import request from '@/utils/request'
import { initData } from '@/api/data'

export function add(data) {
  return request({
    url: 'api/dpServerConfig',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/dpServerConfig/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/dpServerConfig',
    method: 'put',
    data
  })
}

export function saveOrUpdate(data) {
  return request({
    url: 'api/dpServerConfig/saveOrUpdate',
    method: 'post',
    data
  })
}

export function saveOrUpdate2(data) {
  return request({
    url: 'api/dpServerConfig/saveOrUpdate2',
    method: 'post',
    data
  })
}

export function getServerList(data) {
  return request({
    url: '/api/dpUserServer/all',
    method: 'get',
    data
  })
}

export function getAllServerList(data) {
  return initData('/api/dpServer/all', data)
}
export default { add, edit, del, getAllServerList }
